<!-- Author: Mik -->
<html>
 <head>
  <title>Mik's Scrolling Battle Text API</title>
  <style type="text/css">
   body { font-size : 10pt; font-family : verdana,arial,helvetica,sans-serif; }
   hr   { color : #e0e0e0; }

   a:link    { color : #000060; text-decoration : none; }
   a:visited { color : #000060; text-decoration : none; }
   a:hover   { text-decoration : underline; }

   div.TOCTitle        { font-weight : bold; font-size : 12pt; }
   div.TOC             { margin : 2ex 1ex 2ex 2ex; }
   div.TOCSection      { margin : 1ex 1ex 2ex 2ex; }

   div.SectionTitle    { margin-top : 6ex; font-weight : bold; font-size : 14pt; }
   div.SectionDesc     { margin-top : 1ex; margin-bottom : 2ex; }
   div.SubsectionTitle { font-weight : bold; }
   div.SubsectionBody  { margin : 2ex 10ex 2ex 5ex; }
   div.Syntax          { background-color : #e0e0e0; padding-left : 1ex; }

   td.ParameterName { font-size : 10pt; background-color : #e0e0e0; vertical-align : top; }
   td.ParameterDesc { font-size : 10pt; background-color : #e0e0e0; text-align : left; }
  </style>
 </head>
 <body>
  <div>
   This file contains a reference for all of MSBT's publicly accessible functions and structures.<br /><br />
   <div class="TOCTitle"><a name="TOC">Table of Contents:</a></div>
  </div>
  <div class="TOC">
   <b>Mod State:</b>
   <div class="TOCSection">
    <a href="#MikSBT.IsModDisabled">MikSBT.IsModDisabled</a><br />

   </div>
   <b>Displaying Messages:</b>
   <div class="TOCSection">
    <a href="#DisplayOverview">Displaying Messages Overview</a><br />
    <a href="#MikSBT.RegisterFont">MikSBT.RegisterFont</a><br />
    <a href="#MikSBT.DisplayMessage">MikSBT.DisplayMessage</a><br />
    <a href="#MikSBT.IterateFonts">MikSBT.IterateFonts</a><br />
    <a href="#MikSBT.IterateScrollAreas">MikSBT.IterateScrollAreas</a><br />
	<span style="color : red;">MikSBT.GetRegisteredFontList - DEPRECATED</span><br />
	<span style="color : red;">MikSBT.GetScrollAreaList - DEPRECATED</span><br />

   </div>
   <b>Sounds:</b>
   <div class="TOCSection">
    <a href="#SoundsOverview">Sounds Overview</a><br />
    <a href="#MikSBT.RegisterSound">MikSBT.RegisterSound</a><br />
    <a href="#MikSBT.IterateSounds">MikSBT.IterateSounds</a><br />

   </div>
   <b>Custom Animation Styles:</b>
   <div class="TOCSection">
    <a href="#CustomAnimationStylesOverview">Custom Animation Styles Overview</a><br />
    <a href="#MikSBT.RegisterAnimationStyle">MikSBT.RegisterAnimationStyle</a><br />
    <a href="#MikSBT.RegisterStickyAnimationStyle">MikSBT.RegisterStickyAnimationStyle</a><br />
    <a href="#InitDisplayEventCallback">InitDisplayEvent Callback</a><br />
    <a href="#AnimationCallback">Animation Callback</a><br />
    <a href="#DisplayEventTable">DisplayEvent Table</a><br />
   </div>
  </div>


  <div class="SectionTitle"><a name="MikSBT.IsModDisabled">MikSBT.IsModDisabled</a></div>
  <hr size="1" />
  <a href="#TOC">Return to TOC</a><br /><br />
  <div class="SectionDesc">
   Returns a flag indicating if the mod is disabled.
  </div>
  <div class="SubsectionTitle">Syntax</div>
  <div class="SubsectionBody">
   <div class="Syntax"><i>isDisabled</i> = <b>MikSBT.IsModDisabled()</b></div>
  </div>

  <div class="SubsectionTitle">Parameters</div>
  <div class="SubsectionBody">
   None.
  </div>
  
  <div class="SubsectionTitle">Return Values</div>
  <div class="SubsectionBody">
   <table cellspacing="3">
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>isDisabled</i></td>
     <td class="ParameterDesc">
      A flag that indicates if the mod is disabled.  The return value will be one of the following:<br /><br />
      <ul>
       <li>true - The mod is disabled.</li>
       <li>nil - The mod is enabled.</li>
      </ul>
     </td>
    </tr>
   </table>
  </div>

  <div class="SubsectionTitle">Example</div>
  <div class="SubsectionBody">
   <div class="Syntax">
    -- Do something special if MSBT is disabled.<br />
    if MikSBT.IsModDisabled() then<br />
	&nbsp;-- Do something special here.<br />
	end
   </div>
  </div>

  <div class="SubsectionTitle">Remarks</div>
  <div class="SubsectionBody">
   None.
  </div>


  <div class="SectionTitle"><a name="DisplayOverview">Displaying Messages Overview</a></div>
  <hr size="1" />
  <a href="#TOC">Return to TOC</a><br /><br />
  <div class="SectionDesc">
   MSBT allows you to output messages via the <a href="#MikSBT.DisplayMessage">MikSBT.DisplayMessage</a> function.
   You can either output the messages using one of the existing fonts, which can be obtained with the <a href="#MikSBT.IterateFonts">MikSBT.IterateFonts</a> function, or first use the
   <a href="#MikSBT.RegisterFont">MikSBT.RegisterFont</a> function to use your own custom font.<br /><br />
   Additionally, you may call the <a href="#MikSBT.IterateScrollAreas">MikSBT.IterateScrollAreas</a> function to get an iterator for the valid scroll areas in which the message
   may be displayed.
  </div>


  <div class="SectionTitle"><a name="MikSBT.RegisterFont">MikSBT.RegisterFont</a></div>
  <hr size="1" />
  <a href="#TOC">Return to TOC</a><br /><br />
  <div class="SectionDesc">
   Registers a font with MSBT.<br /><br />
   Font registration is not permanent.  It must be done each load.  In this manner if the user were to remove
   a mod that registers custom fonts, the fonts would simply no longer be available.  If anything in MSBT has a
   custom font selected that is no longer registered, MSBT will recognize that an invalid font is specified and
   use the default font accordingly.
  </div>
  <div class="SubsectionTitle">Syntax</div>
  <div class="SubsectionBody">
   <div class="Syntax"><b>MikSBT.RegisterFont(</b><i>fontName</i><b>,</b> <i>fontPath</i><b>)</b></div>
  </div>

  <div class="SubsectionTitle">Parameters</div>
  <div class="SubsectionBody">
   <table cellspacing="3">
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>fontName</i> (Required)</td>
     <td class="ParameterDesc">
      The name to use for the font.  This name will be displayed in the font selection
      dialogs, and also is the name to be referenced when displaying messages via the
      <a href="#MikSBT.DisplayMessage">MikSBT.DisplayMessage</a> function.
     </td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>fontPath</i> (Required)</td>
     <td class="ParameterDesc">The filesystem path to where the font resides.</td>
    </tr>
   </table>
  </div>

  <div class="SubsectionTitle">Return Values</div>
  <div class="SubsectionBody">
   None.
  </div>

  <div class="SubsectionTitle">Example</div>
  <div class="SubsectionBody">
   <div class="Syntax">
    -- Registers a font named "MyUberFont" with MSBT.<br />
    MikSBT.RegisterFont("MyUberFont", "Interface\\AddOns\\MyModName\\Fonts\\MyUberFont.ttf");
   </div>
  </div>

  <div class="SubsectionTitle">Remarks</div>
  <div class="SubsectionBody">
   If you attempt to register a font name that already exists, the function will quietly fail.
  </div>


  <div class="SectionTitle"><a name="MikSBT.DisplayMessage">MikSBT.DisplayMessage</a></div>
  <hr size="1" />
  <a href="#TOC">Return to TOC</a><br /><br />
  <div class="SectionDesc">Displays the passed message with the passed formatting options.</div>
  <div class="SubsectionTitle">Syntax</div>
  <div class="SubsectionBody">
   <div class="Syntax"><b>MikSBT.DisplayMessage(</b><i>message</i> <b>[,</b> <i>scrollArea</i><b>,</b> <i>isSticky</i><b>,</b> <i>colorR</i><b>,</b> <i>colorG</i><b>,</b> <i>colorB</i><b>,</b> <i>fontSize</i><b>,</b> <i>fontName</i><b>,</b> <i>outlineIndex</i><b>,</b> <i>texturePath</i><b>])</b></div>
  </div>

  <div class="SubsectionTitle">Parameters</div>
  <div class="SubsectionBody">
   <table cellspacing="3">
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>message</i> (Required)</td>
     <td class="ParameterDesc">The string to display.</td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>scrollArea</i> (Optional)</td>
     <td class="ParameterDesc">
      Specifies the scroll area key or scroll area name in which to display the message.
      <br /><br />
      You can get an iterator for the available scroll areas with the
      <a href="#MikSBT.IterateScrollAreas">MikSBT.IterateScrollAreas</a> function, or use one of the following predefined values:<br /><br />

      MikSBT.DISPLAYTYPE_INCOMING<br />
      MikSBT.DISPLAYTYPE_OUTGOING<br />
      MikSBT.DISPLAYTYPE_NOTIFICATION<br />
      MikSBT.DISPLAYTYPE_STATIC<br /><br />

      If the parameter is omitted or invalid, a default of MikSBT.DISPLAYTYPE_NOTIFICATION will be used.
     </td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>isSticky</i> (Optional)</td>
     <td class="ParameterDesc">
      Specifies whether or not the message should be displayed sticky style. This must be either true or false.<br /><br />
      If the parameter is omitted, a default of false will be used.
     </td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>colorR</i> (Optional)</td>
     <td class="ParameterDesc">
      The red component of the color to display the message with.  Value range is 0-255.<br /><br />
      If the parameter is omitted, a default of 255 will be used.
     </td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>colorG</i> (Optional)</td>
     <td class="ParameterDesc">
      The green component of the color to display the message with.  Value range is 0-255.<br /><br />
      If the parameter is omitted, a default of 255 will be used.
     </td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>colorB</i> (Optional)</td>
     <td class="ParameterDesc">
      The blue component of the color to display the message with.  Value range is 0-255.<br /><br />
      If the parameter is omitted, a default of 255 will be used.
     </td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>fontSize</i> (Optional)</td>
     <td class="ParameterDesc">
      The font size to use.  Value range is 4-38.<br /><br />
      If this value is omitted or an invalid value is passed, the settings for the scroll area will be used.
     </td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>fontName</i> (Optional)</td>
     <td class="ParameterDesc">
      The name of the font to use.
      <br /><br />
      You can get a list of available font names with the
      <a href="#MikSBT.IterateFonts">MikSBT.IterateFonts</a> function.<br /><br />
      If the parameter is omitted or an invalid font name is passed, the font for the scroll area will be used.
     </td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>outlineIndex</i> (Optional)</td>
     <td class="ParameterDesc">
      The index of the outline to use. The valid values are:
      <ul>
       <li>1 - No Outline</li>
       <li>2 - Thin</li>
       <li>3 - Thick</li>
      </ul>
      If the parameter is omitted or an invalid index is passed, the outline index for the scroll area will be used.
     </td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>texturePath</i> (Optional)</td>
     <td class="ParameterDesc">
      The path to a texture file to display.<br /><br />
      If the parameter is omitted or an invalid path is passed, no texture will be displayed.
     </td>
    </tr>
   </table>
  </div>

  <div class="SubsectionTitle">Return Values</div>
  <div class="SubsectionBody">None.</div>

  <div class="SubsectionTitle">Examples</div>
  <div class="SubsectionBody">
   <div class="Syntax">
    -- Displays "Test Message" in the notification scroll area in white.<br />
    MikSBT.DisplayMessage("Test Message");<br /><br />
 
    -- Displays "Another Message" in the incoming scroll area in white as a sticky.<br />
    MikSBT.DisplayMessage("Another Message", MikSBT.DISPLAYTYPE_INCOMING, true);<br /><br />

    -- Displays "Uber Damage!" in the outgoing scroll area in blue.<br />
    MikSBT.DisplayMessage("Uber Damage!", MikSBT.DISPLAYTYPE_OUTGOING, false, 0, 0, 255);<br /><br />

    -- Displays "Enemy begins to flee in fear" in the notification scroll area in green with the<br />
    -- scroll area's font size, the font set to Yellowjacket, no outline, and the icon for fear.<br />
    MikSBT.DisplayMessage("Enemy begins to flee in fear", nil, false, 0, 255, 0, nil, "Yellowjacket", 1, "Interface\\Icons\\Spell_Shadow_Possession");
   </div>
  </div>

  <div class="SubsectionTitle">Remarks</div>
  <div class="SubsectionBody">
   Since this function specifies the font name to use, you can use custom fonts by first registering them via the
   <a href="#MikSBT.RegisterFont">MikSBT.RegisterFont</a> function.
  </div>


  <div class="SectionTitle"><a name="MikSBT.IterateFonts">MikSBT.IterateFonts</a></div>
  <hr size="1" />
  <a href="#TOC">Return to TOC</a><br /><br />
  <div class="SectionDesc">
   Returns an iterator function for the table containing the registered fonts.
  </div>
  <div class="SubsectionTitle">Syntax</div>
  <div class="SubsectionBody">
   <div class="Syntax"><i>for fontName, fontPath in</i> <b>MikSBT.IterateFonts()</b> <i>do</i></div>
  </div>

  <div class="SubsectionTitle">Parameters</div>
  <div class="SubsectionBody">None.</div>

  <div class="SubsectionTitle">Return Values</div>
  <div class="SubsectionBody">
   <table cellspacing="3">
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>iterator</i></td>
     <td class="ParameterDesc">
      An iterator function for the table containing the registered fonts.<br /><br />
      The format of the table is as follows:<br /><br />
      &nbsp;&nbsp;["FontName1"] = "Font Path 1"<br />
      &nbsp;&nbsp;["FontName2"] = "Font Path 2"<br />
     </td>
    </tr>
   </table>
  </div>

  <div class="SubsectionTitle">Examples</div>
  <div class="SubsectionBody">
   <div class="Syntax">
    -- Print the font names registered with MSBT.<br />
    for fontName, fontPath in MikSBT.IterateFonts() do<br />
     &nbsp;DEFAULT_CHAT_FRAME:AddMessage(fontName);<br />
    end<br />
   </div>
  </div>

  <div class="SubsectionTitle">Remarks</div>
  <div class="SubsectionBody">
   This function has superseded the <span style="color : red;">MikSBT.GetRegisteredFontList</span> function.  The
   old function created a new table and returned it every time it was called which was wasteful.
  </div>


  <div class="SectionTitle"><a name="MikSBT.IterateScrollAreas">MikSBT.IterateScrollAreas</a></div>
  <hr size="1" />
  <a href="#TOC">Return to TOC</a><br /><br />
  <div class="SectionDesc">
   Returns an iterator function for the table containing the available scroll areas.
  </div>
  <div class="SubsectionTitle">Syntax</div>
  <div class="SubsectionBody">
   <div class="Syntax"><i>for scrollAreaKey, scrollAreaName in</i> <b>MikSBT.IterateScrollAreas()</b> <i>do</i></div>
  </div>

  <div class="SubsectionTitle">Parameters</div>
  <div class="SubsectionBody">None.</div>

  <div class="SubsectionTitle">Return Values</div>
  <div class="SubsectionBody">
   <table cellspacing="3">
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>iterator</i></td>
     <td class="ParameterDesc">
      An iterator function for the table containing the available scroll areas.<br /><br />
      The format of the table is as follows:<br /><br />
      &nbsp;&nbsp;["FirstKey"] = "First Scroll Area Name"<br />
      &nbsp;&nbsp;["SecondKey"] = "Second Scroll Area Name"<br />
     </td>
    </tr>
   </table>
  </div>

  <div class="SubsectionTitle">Examples</div>
  <div class="SubsectionBody">
   <div class="Syntax">
    -- Print MSBT's available scroll area names.<br />
    for scrollAreaKey, scrollAreaName in MikSBT.IterateScrollAreas() do<br />
     &nbsp;DEFAULT_CHAT_FRAME:AddMessage(scrollAreaName);<br />
    end
   </div>
  </div>

  <div class="SubsectionTitle">Remarks</div>
  <div class="SubsectionBody">
   This function has superseded the <span style="color : red;">MikSBT.GetScrollAreaList</span> function.  The
   old function created a new table and returned it every time it was called which was wasteful.
  </div>


  <div class="SectionTitle"><a name="SoundsOverview">Sounds Overview</a></div>
  <hr size="1" />
  <a href="#TOC">Return to TOC</a><br /><br />
  <div class="SectionDesc">
   MSBT allows you to register sounds which the user can assign to be played when events and triggers occur.<br /><br />

   The <a href="#MikSBT.RegisterSound">MikSBT.RegisterSound</a> function is used to register the sounds, and the
   registered sounds may be obtained by using the <a href="#MikSBT.IterateSounds">MikSBT.IterateSounds</a> function.
  </div>


  <div class="SectionTitle"><a name="MikSBT.RegisterSound">MikSBT.RegisterSound</a></div>
  <hr size="1" />
  <a href="#TOC">Return to TOC</a><br /><br />
  <div class="SectionDesc">
   Registers a sound with MSBT.<br /><br />
   Sound registration is not permanent.  It must be done each load.  In this manner if the user were to remove
   a mod that registers custom sounds, the sounds would simply no longer be available.
  </div>
  <div class="SubsectionTitle">Syntax</div>
  <div class="SubsectionBody">
   <div class="Syntax"><b>MikSBT.RegisterSound(</b><i>soundName</i><b>,</b> <i>soundPath</i><b>)</b></div>
  </div>

  <div class="SubsectionTitle">Parameters</div>
  <div class="SubsectionBody">
   <table cellspacing="3">
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>soundName</i> (Required)</td>
     <td class="ParameterDesc">
      The name to use for the sound.  This name will be displayed in the sound selection
      dialogs.
     </td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>soundPath</i> (Required)</td>
     <td class="ParameterDesc">The filesystem path to where the sound resides.</td>
    </tr>
   </table>
  </div>

  <div class="SubsectionTitle">Return Values</div>
  <div class="SubsectionBody">
   None.
  </div>

  <div class="SubsectionTitle">Example</div>
  <div class="SubsectionBody">
   <div class="Syntax">
    -- Registers a sound named "MyUberSound" with MSBT.<br />
    MikSBT.RegisterSound("MyUberSound", "Interface\\AddOns\\MyModName\\Sounds\\MyUberSound.mp3");
   </div>
  </div>

  <div class="SubsectionTitle">Remarks</div>
  <div class="SubsectionBody">
   If you attempt to register a sound name that already exists, the function will quietly fail.
  </div>


  <div class="SectionTitle"><a name="MikSBT.IterateSounds">MikSBT.IterateSounds</a></div>
  <hr size="1" />
  <a href="#TOC">Return to TOC</a><br /><br />
  <div class="SectionDesc">
   Returns an iterator function for the table containing the registered sounds.
  </div>
  <div class="SubsectionTitle">Syntax</div>
  <div class="SubsectionBody">
   <div class="Syntax"><i>for soundName, soundPath in</i> <b>MikSBT.IterateSounds()</b> <i>do</i></div>
  </div>

  <div class="SubsectionTitle">Parameters</div>
  <div class="SubsectionBody">None.</div>

  <div class="SubsectionTitle">Return Values</div>
  <div class="SubsectionBody">
   <table cellspacing="3">
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>iterator</i></td>
     <td class="ParameterDesc">
      An iterator function for the table containing the registered sounds.<br /><br />
      The format of the table is as follows:<br /><br />
      &nbsp;&nbsp;["SoundName1"] = "Sound Path 1"<br />
      &nbsp;&nbsp;["SoundName2"] = "Sound Path 2"<br />
     </td>
    </tr>
   </table>
  </div>

  <div class="SubsectionTitle">Examples</div>
  <div class="SubsectionBody">
   <div class="Syntax">
    -- Print the sound names registered with MSBT.<br />
    for soundName, soundPath in MikSBT.IterateSounds() do<br />
     &nbsp;DEFAULT_CHAT_FRAME:AddMessage(soundName);<br />
    end<br />
   </div>
  </div>

  <div class="SubsectionTitle">Remarks</div>
  <div class="SubsectionBody">None.</div>


  <div class="SectionTitle"><a name="CustomAnimationStylesOverview">Custom Animation Styles Overview</a></div>
  <hr size="1" />
  <a href="#TOC">Return to TOC</a><br /><br />
  <div class="SectionDesc">
   MSBT has a custom animation style registration system that allows other mod authors to create new animation styles.
   <br /><br />
   The system works by allowing an initialization callback handler, directions, and behaviors for an animation style to be
   registered with the <a href="#MikSBT.RegisterAnimationStyle">MikSBT.RegisterAnimationStyle</a> and
   <a href="#MikSBT.RegisterStickyAnimationStyle">MikSBT.RegisterStickyAnimationStyle</a> functions.  The supplied initialization
   handler then sets the appropriate animation handler for each new <a href="#DisplayEventTable">DisplayEvent</a> it receives.
   <br /><br />

   The callback handlers receive recycled <a href="#DisplayEventTable">DisplayEvent</a> tables that contain information about an animating event
   such as its x and y position, its alpha (opacity), the height of the scroll area it's animating in, how long it's been animating, and the user
   specified animation speed.
   <br /><br />

   There are two callback handlers:
   <table cellspacing="3">
    <tr>
     <td class="ParameterName" nowrap="nowrap"><a href="#InitDisplayEventCallback">InitDisplayEvent</a></td>
     <td class="ParameterDesc">
      This function receives a new <a href="#DisplayEventTable">DisplayEvent</a> table, an array of <a href="#DisplayEventTable">DisplayEvent</a>s that are
      currently active for the scroll area using the same animation style, and the currently selected direction and behavior for the scroll area.
      <br /><br />
      The most important thing for this function to do is set the <i>.animationHandler</i> field for the new
      <a href="#DisplayEventTable">DisplayEvent</a> to an appropriate <a href="#AnimationCallback">Animation</a> callback handler.
      The handler <b>MUST</b> be set.
      <br /><br />
	  Other things to be done are to establish the initial settings for the new <a href="#DisplayEventTable">DisplayEvent</a> table,
      create any additional fields you need for your animation code, and move the active <a href="#DisplayEventTable">DisplayEvent</a>s
      that are now colliding due to the newly added event if your animation style should avoid overlaps.
     </td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><a href="#AnimationCallback">Animation</a></td>
     <td class="ParameterDesc">
      This function moves the <a href="#DisplayEventTable">DisplayEvent</a> at each update interval by modifying the <i>.positionX</i> and <i>.positionY</i> fields.
      The opacity is controlled by modifying the <i>.alpha</i> field.
      <br /><br />
      Once the animation has completed the function <b>MUST</b> return true so that the objects in use for the
      animation may be reused and the mod stops calling the function.
     </td>
    </tr>
   </table>
  </div>


  <div class="SectionTitle"><a name="MikSBT.RegisterAnimationStyle">MikSBT.RegisterAnimationStyle</a></div>
  <hr size="1" />
  <a href="#TOC">Return to TOC</a><br /><br />
  <div class="SectionDesc">
   Registers a new animation style with MSBT.
   <br /><br />
   Custom animation style registration is not permanent. It must be done each load.  In order to remove a custom
   animation style, all that needs to be done is no longer register it on subsequent loads.  If any of the scroll
   areas have a custom animation style selected that is no longer registered, MSBT will recognize that an invalid
   animation style is specified and use the default animation style accordingly.<br /><br />
  </div>
  <div class="SubsectionTitle">Syntax</div>
  <div class="SubsectionBody">
   <div class="Syntax"><b>MikSBT.RegisterAnimationStyle(</b><i>styleID</i><b>,</b> <i>initHandler</i><b>,</b> <i>availableDirections</i><b> [,</b> <i>availableBehaviors</i><b>,</b> <i>localizationTable</i><b>])</b></div>
  </div>

  <div class="SubsectionTitle">Parameters</div>
  <div class="SubsectionBody">
   <table cellspacing="3">
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>styleID</i> (Required)</td>
     <td class="ParameterDesc">
      A unique string that identifies the animation style.
     </td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>initHandler</i> (Required)</td>
     <td class="ParameterDesc">
      Your <a href="#InitDisplayEventCallback">InitDisplayEvent</a> callback handler.
     </td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>availableDirections</i> (Required)</td>
     <td class="ParameterDesc">
      A string that contains a semicolon separated list of the available directions for the animation style.<br /><br />
     </td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>availableBehaviors</i> (Optional)</td>
     <td class="ParameterDesc">
      A string that contains a semicolon separated list of the available behaviors for the animation style.<br /><br />
     </td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>localizationTable</i> (Optional)</td>
     <td class="ParameterDesc">
      A table that contains translations.<br /><br />
      The strings provided in the <i>styleID</i>, <i>availableDirections</i>, and <i>availableBehaviors</i> parameters
	  will by used as the key into this table to find an appropriate translation.
     </td>
    </tr>
   </table>
  </div>

  <div class="SubsectionTitle">Return Values</div>
  <div class="SubsectionBody">None.</div>

  <div class="SubsectionTitle">Examples</div>
  <div class="SubsectionBody">
   <div class="Syntax">
    -- Register a new animation style with MSBT.<br />
    MikSBT.RegisterAnimationStyle("MyModNameUberAnimation", myInitHandler, "Up;Down", "Implode;Explode", myLocalizationTable);
   </div>
  </div>

  <div class="SubsectionTitle">Remarks</div>
  <div class="SubsectionBody">
   If you attempt to register a <i>styleID</i> that already exists, the function will quietly fail.
   An easy way to make sure you have a unique <i>styleID</i> is to preprend your mod's name to it as demonstrated in the example.
  </div>


  <div class="SectionTitle"><a name="MikSBT.RegisterStickyAnimationStyle">MikSBT.RegisterStickyAnimationStyle</a></div>
  <hr size="1" />
  <a href="#TOC">Return to TOC</a><br /><br />
  <div class="SectionDesc">
   Registers a new sticky animation style with MSBT.
   <br /><br />
   Custom animation style registration is not permanent. It must be done each load.  In order to remove a custom animation style, all that needs to be done is
   no longer register it on subsequent loads.  If any of the scroll areas have a custom animation style selected that is no longer registered, MSBT will recognize that an invalid
   animation style is specified and use the default animation style accordingly.<br /><br />
  </div>
  <div class="SubsectionTitle">Syntax</div>
  <div class="SubsectionBody">
   <div class="Syntax"><b>MikSBT.RegisterStickyAnimationStyle(</b><i>styleID</i><b>,</b> <i>initHandler</i><b>,</b> <i>availableDirections</i><b> [,</b> <i>availableBehaviors</i><b>,</b> <i>localizationTable</i><b>])</b></div>
  </div>

  <div class="SubsectionTitle">Parameters</div>
  <div class="SubsectionBody">
   <table cellspacing="3">
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>styleID</i> (Required)</td>
     <td class="ParameterDesc">
      A unique string that identifies the animation style.
     </td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>initHandler</i> (Required)</td>
     <td class="ParameterDesc">
      Your <a href="#InitDisplayEventCallback">InitDisplayEvent</a> callback handler.
     </td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>availableDirections</i> (Required)</td>
     <td class="ParameterDesc">
      A string that contains a semicolon separated list of the available directions for the animation style.<br /><br />
     </td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>availableBehaviors</i> (Optional)</td>
     <td class="ParameterDesc">
      A string that contains a semicolon separated list of the available behaviors for the animation style.<br /><br />
     </td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>localizationTable</i> (Optional)</td>
     <td class="ParameterDesc">
      A table that contains translations.<br /><br />
      The strings provided in the <i>styleID</i>, <i>availableDirections</i>, and <i>availableBehaviors</i> parameters
	  will by used as the key into this table to find an appropriate translation.
     </td>
    </tr>
   </table>
  </div>

  <div class="SubsectionTitle">Return Values</div>
  <div class="SubsectionBody">None.</div>

  <div class="SubsectionTitle">Examples</div>
  <div class="SubsectionBody">
   <div class="Syntax">
    -- Register a new sticky animation style with MSBT.<br />
    MikSBT.RegisterStickyAnimationStyle("MyModNameUberStickyAnimation", myInitHandler, "Up;Down", "Jiggle;Normal", myLocalizationTable);
   </div>
  </div>

  <div class="SubsectionTitle">Remarks</div>
  <div class="SubsectionBody">
   If you attempt to register a <i>styleID</i> that already exists, the function will quietly fail.
   An easy way to make sure you have a unique <i>styleID</i> is to preprend your mod's name to it as demonstrated in the example.
  </div>


  <div class="SectionTitle"><a name="InitDisplayEventCallback">InitDisplayEvent Callback</a></div>
  <hr size="1" />
  <a href="#TOC">Return to TOC</a><br /><br />
  <div class="SectionDesc">
   Each time a new <a href="#DisplayEventTable">DisplayEvent</a> is added to a scroll area, this function is called with it, an array of
   other <a href="#DisplayEventTable">DisplayEvent</a>s that are currently active for the scroll area, and the currently selected direction
   and behavior for the scroll area.
   <br /><br />
   The most important thing for this function to do is set the <i>.animationHandler</i> field for the new <a href="#DisplayEventTable">DisplayEvent</a>
   to an appropriate <a href="#AnimationCallback">Animation</a> callback handler.
   <br /><br />
   The other purpose of this function is to initialize the starting position, alpha, and any other information you need for the new
   <a href="#DisplayEventTable">DisplayEvent</a>, and to move any other <a href="#DisplayEventTable">DisplayEvent</a>s that are now colliding due to the new event.
   <br /><br />
   <b>This function MUST set the <i>.animationHandler</i> field of the <i>newDisplayEvent</i> parameter to a valid <a href="#AnimationCallback">Animation</a> callback handler.</b>
  </div>
  <div class="SubsectionTitle">Syntax</div>
  <div class="SubsectionBody">
   <div class="Syntax"><b>function myInitHandler(</b><i>newDisplayEvent</i><b>,</b> <i>activeDisplayEvents</i><b> [,</b> <i>direction</i><b>,</b> <i>behavior</i><b>])</b></div>
  </div>

  <div class="SubsectionTitle">Parameters</div>
  <div class="SubsectionBody">
   <table cellspacing="3">
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>newDisplayEvent</i> (Required)</td>
     <td class="ParameterDesc">
      A <a href="#DisplayEventTable">DisplayEvent</a> table that represents a new event.
     </td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>activeDisplayEvents</i> (Required)</td>
     <td class="ParameterDesc">
      An array of <a href="#DisplayEventTable">DisplayEvent</a> tables that represent the other events
      that are currently active for the scroll area.
     </td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>direction</i> (Optional)</td>
     <td class="ParameterDesc">
      A string that is the currently selected direction for the scroll area.<br /><br />
	  The default animation direction should be used when this parameter is invalid.
     </td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>behavior</i> (Optional)</td>
     <td class="ParameterDesc">
      A string that is the currently selected behavior for the scroll area.<br /><br />
	  The default animation behavior should be used when this parameter is invalid.
     </td>
    </tr>
   </table>
  </div>

  <div class="SubsectionTitle">Return Values</div>
  <div class="SubsectionBody">None.</div>

  <div class="SubsectionTitle">Examples</div>
  <div class="SubsectionBody">
   <div class="Syntax">
    -- Create an InitDisplayEvent callback handler.<br />
    local function myInitHandler(newDisplayEvent, activeDisplayEvents, direction, behavior)<br />
     &nbsp;-- Do stuff in here to initialize the newDisplayEvent and move any activeDisplayEvents that are colliding according to your custom animation style.<br />
    end<br />
   </div>
  </div>

  <div class="SubsectionTitle">Remarks</div>
  <div class="SubsectionBody">
   Take a look at the init functions in the MSBTAnimationStyles.lua file that comes with the mod for an example of how MSBT initializes the default animation styles.<br /><br />
  </div>


  <div class="SectionTitle"><a name="AnimationCallback">Animation Callback</a></div>
  <hr size="1" />
  <a href="#TOC">Return to TOC</a><br /><br />
  <div class="SectionDesc">
   This function is called continously (typically every 15 or so milliseconds) for every active <a href="#DisplayEventTable">DisplayEvent</a> that is animating
   until the function returns true to indicate the animation is complete.
   <br /><br />
   The <a href="#DisplayEventTable">DisplayEvent</a> is positioned by setting its <i>.positionX</i> and <i>.positionY</i> fields, and its opacity is controlled by setting its <i>.alpha</i> field.
   <br /><br />
   The x and y positions should be calculated based upon how much time it has been animating, which is available in the <i>.elapsedTime</i> field, and the height and width of the scroll area available
   in the <i>.scrollHeight</i> and <i>.scrollWidth</i> fields.
   Additionally, the <i>.animationSpeed</i> field should be used to scale the speed of the animation.
   <br /><br />
   By basing your calculations on the elapsed time, the animation will remain consistent under diverse performance situations.  If you were to base it simply on moving a set number of pixels
   each update then the actual scroll speed would vary greatly.  These fields are further described in the <a href="#DisplayEventTable">DisplayEvent</a> Table section.
   <br /><br />
   <b>This function MUST return true when the animation is complete.</b>
  </div>
  <div class="SubsectionTitle">Syntax</div>
  <div class="SubsectionBody">
   <div class="Syntax"><i>animationComplete</i><b> = function myAnimationHandler(</b><i>displayEvent</i><b>)</b></div>
  </div>

  <div class="SubsectionTitle">Parameters</div>
  <div class="SubsectionBody">
   <table cellspacing="3">
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>displayEvent</i> (Required)</td>
     <td class="ParameterDesc">
      A <a href="#DisplayEventTable">DisplayEvent</a> table that represents the animating event.
     </td>
    </tr>
   </table>
  </div>

  <div class="SubsectionTitle">Return Values</div>
  <div class="SubsectionBody">
   <table cellspacing="3">
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>animationComplete</i> (Required)</td>
     <td class="ParameterDesc">
      Return true if the animation is complete and false if it is not.
     </td>
    </tr>
   </table>
  </div>

  <div class="SubsectionTitle">Examples</div>
  <div class="SubsectionBody">
   <div class="Syntax">
    -- Create an Animation callback handler.<br />
    local function myAnimationHandler(displayEvent)<br />
     &nbsp;-- Do stuff in here to animate the displayEvent.<br />
    end<br />
   </div>
  </div>

  <div class="SubsectionTitle">Remarks</div>
  <div class="SubsectionBody">
   Take a look at the scroll functions in the MSBTAnimationStyles.lua file that comes with the mod for an example of how MSBT animates the default animation styles.
  </div>



  <div class="SectionTitle"><a name="DisplayEventTable">DisplayEvent Table</a></div>
  <hr size="1" />
  <a href="#TOC">Return to TOC</a><br /><br />
  <div class="SectionDesc">
   This table respresents an animating event.
  </div>

  <div class="SubsectionTitle">Fields</div>
  <div class="SubsectionBody">
   <table cellspacing="3">
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>.scrollHeight</i> (Read-Only)</td>
     <td class="ParameterDesc">
      This field contains the height of the scroll area the event is animating in.
     </td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>.scrollWidth</i> (Read-Only)</td>
     <td class="ParameterDesc">
      This field contains the width of the scroll area the event is animating in.
     </td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>.fontSize</i> (Read-Only)</td>
     <td class="ParameterDesc">
      This field contains the size of the font used for the event.
     </td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>.fontString</i> (Read-Only)</td>
     <td class="ParameterDesc">
      This field contains the &lt;FontString&gt; object that the event is using to display the text.<br /><br />
      A dynamic pool of font strings is maintained and reused by MSBT.
     </td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>.anchorPoint</i> (Read-Only)</td>
     <td class="ParameterDesc">
      This field contains anchor point for &lt;FontString&gt; that the event is using to display the text.<br /><br />
      It will be "BOTTOMLEFT", "BOTTOM", or "BOTTOMRIGHT", corresponding to left, center, and right text alignment.
     </td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>.animationSpeed</i> (Read-Only)</td>
     <td class="ParameterDesc">
      The user selected animation speed.  This is a decimal representation of a percentage.
      <br /><br />
      For example, 0.5 means that the animation should animate at 50% of the normal speed,
      1.0 means it should animate at normal speed, and 2.5 means it should animate at 250% of normal speed.
     </td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>.positionX</i> (Read-Write)</td>
     <td class="ParameterDesc">
      The x position of the event to be set once the function returns.
      <br /><br />
      MSBT handles all scroll area offsetting. x = 0 refers to the text's attachment point (left, right, or center).
      Negative values for x move the text to the left, and positive values moves the text to the right.
     </td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>.positionY</i> (Read-Write)</td>
     <td class="ParameterDesc">
      The y position of the event to be set once the function returns.
      <br /><br />
      MSBT handles all scroll area offsetting. y = 0 refers to the bottom point of the scroll area and increases upward.
     </td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>.alpha</i> (Read-Write)</td>
     <td class="ParameterDesc">
      The opacity of the event to be set once the function returns.
      <br /><br />
      The value range is from 0 (invisible) to 1 (fully visible).
     </td>
    </tr>
    <tr>
     <td class="ParameterName" nowrap="nowrap"><i>.elapsedTime</i> (Read-Write)</td>
     <td class="ParameterDesc">
      The amount of time the event has been animating.
     </td>
    </tr>
   </table>
  </div>

  <div class="SubsectionTitle">Remarks</div>
  <div class="SubsectionBody">
   Technically the fields marked as read-only are normal fields just like the rest, however they should be treated as read-only.  Altering them can cause unexpected behavior.
   I didn't want to add the extra overhead it would take to truly make them read-only.  There are also a few other internal fields that should not be altered.
  </div>


 </body>
</html>